﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Xml.Linq;

namespace Scheduler
{
    public partial class Page : UserControl
    {
        private IEnumerable<XElement> Rooms;

        public Page()
        {
            InitializeComponent();

            this.Loaded += new RoutedEventHandler(Page_Loaded);
        }

        void Page_Loaded(object sender, RoutedEventArgs e)
        {
            WebClient DataLoader = new WebClient();
            DataLoader.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DataLoader_DownloadStringCompleted);
            DataLoader.DownloadStringAsync(new Uri("SessionList.xml",UriKind.RelativeOrAbsolute));
        }

        void DataLoader_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                //need to use LINQ to create objects from the XML
            }
        }
    }
}
